package com.tledu.core;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author 100996
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AjaxResult<T> {

    private boolean success;
    private String msg;
    private T data;
    private int code;

    public AjaxResult(boolean success, String msg) {
        this.msg = msg;
        this.success = success;
    }

    public AjaxResult(String msg, T data) {
        this.msg = msg;
        this.data = data;
        this.code = 0;
        this.success = true;
    }

    public AjaxResult(String msg, Integer code, T data) {
        this.msg = msg;
        this.code = code;
        this.data = data;
        this.success = false;
    }

}
